package com.yuncheng.oaApi.constant;

import org.springframework.stereotype.Component;

@Component("OafwFlowConstant")
public class OafwOaFlowConstants implements OaFlowConstants {

    public final static String LCMC_LIKE_OALC = "广西壮族自治区食品药品审评查验中心文件";

    //流程处理
    public final static String NODENAME = "拟稿,科室审核,办公室审核,会签,分管领导审核,领导审批,盖红章打印,归档";

    public final static String HJMC_NG = "拟稿";
    public final static String HJMC_KSSH = "科室审核";
    public final static String HJMC_BGSSH = "办公室审核";
    public final static String HJMC_HQ = "会签";
    public final static String HJMC_FGLDSP = "分管领导审核";
    public final static String HJMC_LDSP = "领导审批";
    public final static String HJMC_GHZDY = "盖红章打印";
    public final static String HJMC_GT = "归档";

//     会签
//      |
//->办公室审核 ->领导审批
//      |
//分管领导审核


    //公文形式
    public final static String GWXS_DZWJ = "党组文件";
    public final static String GWXS_DZH = "党组函";
    public final static String GWXS_JWJ = "局文件";
    public final static String GWXS_JH = "局函";
    public final static String GWXS_GG = "公告";
    public final static String GWXS_TG = "通告";
    public final static String GWXS_JY = "纪要";
    public final static String GWXS_BGSWJ = "办公室文件";
    public final static String GWXS_BGSH = "办公室函";
    public final static String GWXS_JKDW = "机关党委";
    public final static String GWXS_ZGB = "职改办";

    // 流程办理按钮类型 - 保存
    public final static String SUBMIT_TYPE_SAVE = "0";

    // 流程办理按钮类型 - 提交
    public final static String SUBMIT_TYPE_SUBMIT = "1";

    // 获取第一环节
    public String getFirstNode() {
        String nodeNameList[] = NODENAME.split(",");
        return nodeNameList[0];
    }


    //办理方式
    public String getBlfs(String nodeName) {
        return OaCommonFlowConstant.BLFS_DRBX;
    }

    //流程编码
    @Override
    public String getFywflcode() {
        return "oafw001";
    }

    //获取流程名称
    @Override
    public String getFlowName() {
        return "广西壮族自治区食品药品审评查验中心文件";
    }

    // 获取下环节名称
    public String getNextNodeName(String nowNodeName) {
        String nodeNameList[] = NODENAME.split(",");
        for (int i = 0; i < nodeNameList.length; i++) {
            if (nodeNameList[i].equals(nowNodeName)) {
                if (i == nodeNameList.length - 1) {
                    return HJMC_LCJS;
                } else {
                    return nodeNameList[i + 1];
                }
            }
        }
        return "";
    }

    // 获取上一个环节名称
    public String getPreviousName(String nowNodeName) {
        String[] nodeNameList = NODENAME.split(",");

        for (int i = 0; i < nodeNameList.length; i++) {
            if (nodeNameList[i].equals(nowNodeName)) {
                if (i == 0) {
                    return nodeNameList[i];
                } else {
                    int perviousI = i - 1; // 上一个环节名称
                    return nodeNameList[perviousI];
                }
            }
        }
        return "";
    }

    // 获取审评下环节名称
    public String getSpNextNodeName(String nowNodeName) {

        return null;
    }

    // 获取审评上环节名称
    public String getSpPreviousName(String nowNodeName) {

        return null;
    }


}
